
package Presentation;


import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

public class MenuHistorique extends Menu
{
    
    FenetrePrincipale fp;
    MenuItem          afficherHistorique = new MenuItem("Afficher Historique");
    
    public MenuHistorique(final FenetrePrincipale fp) {
    
        super("Historique");
        this.fp = fp;
        this.getItems().addAll(afficherHistorique);
        
        afficherHistorique.setOnAction(new EventHandler<ActionEvent>()
        {
            
            public void handle(ActionEvent t) {
            
                Group    root1 = new Group();
                FenetreAfficherHistorique histo = new FenetreAfficherHistorique(root1,fp);
                Stage stage = new Stage();
                stage.setTitle("Historique Naviagation");
                stage.setWidth(450);
                stage.setHeight(510);
                stage.setScene(histo);
                stage.show();
//                stage.setOnCloseRequest(new EventHandler<WindowEvent>()
//                        {
//                            
//                            @Override
//                            public void handle(WindowEvent event) {
//                            
//                               
//                                System.out.println("sortir");
//                            }
//                        });

            }
        });
    }
}
